package com.ss.android.article.browser.view.user;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView.ItemDecoration;
import android.support.v7.widget.RecyclerView;
import android.view.View;

public final class w extends ItemDecoration {
    final Paint a;
    final Context b;
    int c;
    private static final int[] d = new int[]{16843284};
    private int e;

    public w(Context arg3) {
        TypedArray v0 = arg3.obtainStyledAttributes(w.d);
        this.b = arg3;
        this.a = new Paint();
        v0.recycle();
        this.e = 1;
    }

    public final void getItemOffsets(Rect arg4, int arg5, RecyclerView arg6) {
        if(this.e == 1) {
            arg4.set(0, 0, 0, ((int)this.a.getStrokeWidth()));
        }
        else {
            arg4.set(0, 0, ((int)this.a.getStrokeWidth()), 0);
        }
    }

    public final void onDraw(Canvas arg12, RecyclerView arg13) {
        View v0;
        int v9;
        int v8;
        int v7;
        float v10 = 2f;
        if(this.e == 1) {
            v7 = arg13.getPaddingLeft();
            v8 = arg13.getWidth() - arg13.getPaddingRight();
            v9 = arg13.getChildCount();
            int v6;
            for(v6 = 0; v6 < v9; ++v6) {
                v0 = arg13.getChildAt(v6);
                arg12.drawLine(((float)(this.c + v7)), (((float)v0.getBottom())) + this.a.getStrokeWidth() / v10, ((float)v8), this.a.getStrokeWidth() / v10 + (((float)v0.getBottom())), this.a);
            }
        }
        else {
            v7 = arg13.getPaddingTop();
            v8 = arg13.getHeight() - arg13.getPaddingBottom();
            v9 = arg13.getChildCount();
            for(int v6 = 0; v6 < v9; ++v6) {
                v0 = arg13.getChildAt(v6);
                arg12.drawLine(((float)v0.getRight()), ((float)(this.c + v7)), ((float)v0.getRight()), ((float)v8), this.a);
            }
        }
    }
}

